<?php
include "sql.php";
$cha=$con->query("select * from userorder where mzhuangtai='1' and zhuangtai='1' ");
$res=[];
$i=0;
?>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/amazeui.min.css" />
		<link rel="stylesheet" href="css/admin.css" />
	</head>

	<body>
	<button><a href="allpaisong.php?all=0">全部派送</a> </button>
			<div class="am-g">
				<div class="am-u-sm-12">
					<form class="am-form">
						<table class="am-table am-table-striped am-table-hover table-main">
							<thead>
								<tr>
									<th class="table-set">订单号</th>
									<th class="table-set">学号</th>
									<th class="table-set">姓名</th>
									<th class="table-set">电话</th>
									<th class="table-set">地址</th>
									<th class="table-set">备注</th>
									<th class="table-set">信息</th>
									<th class="table-set">规格</th>
									<th class="table-set">金额</th>
									<th class="table-set">创建时间</th>
									<th class="table-set">状态</th>
									<th class="table-set">支付状态</th>
									<th class="table-set">完成时间</th>
									<th class="table-set">操作</th>
								</tr>
							</thead>
							<tbody>
								<?php
								foreach($cha as $val){
									$res[$i]=$val;
							echo '<tr>';
							echo '<td>'.$res[$i]['orderhao'].'</td>';
							echo '<td>'.$res[$i]['xuehao'].'</td>';
							echo '<td>'.$res[$i]['username'].'</td>';
							echo '<td>'.$res[$i]['tel'].'</td>';
							echo '<td>'.$res[$i]['lou'].'号楼-'.$res[$i]['sushe'].'</td>';
							echo '<td>'.$res[$i]['beizhu'].'</td>';
							echo '<td>'.$res[$i]['xinxi'].'</td>';
							if($res[$i]['guige']==1){
								$guige="大件送达宿舍";
							}
							if($res[$i]['guige']==2){
								$guige="小件送达宿舍";
							}
							if($res[$i]['guige']==3){
								$guige="顺丰送达宿舍";
							}
							if($res[$i]['guige']==4){
								$guige="京东送达宿舍";
							}
							$time=date('Y-m-s h:i:s',$res[$i]['ctime']);
							echo '<td>'.$guige.'</td>';
							echo '<td>'.$res[$i]['money'].'</td>';
							echo '<td>'.$time.'</td>';
							echo '<td>'.$res[$i]['zhuangtai'].'</td>';
							echo '<td>已支付</td>';
							if($res[$i]['zhuangtai']==0){
								$otime="待取货";
							}if($res[$i]['zhuangtai']==1){
								$otime="待派货";
							}else{
								$otime="已派送";
							}
							echo '<td>'.$otime.'</td>';
							echo '<td><a href="'.'paisong.php?orderhao='.$res[$i]['orderhao'].'">点击以派送</a></td>';

							echo '</tr>';
							$i++;
								}
								?>
								
								
							</tbody>
						</table>
						<hr>
					</form>
				</div>

			</div>
		</div>
		
	
	</body>

</html>




